package com.medical.medical.mapper;

import com.medical.medical.entity.Patient;
import com.medical.medical.entity.Record;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
/**
 * @authorDesc 古娜拉黑暗之神!
 * @author ChenLi
 * @date 2022-09-14 09:43:31
 * @version 1.0.0
 * @description 用户/患者数据访问层
 */
public interface PatientMapper {
    /**
     * @Description: 验证的登陆
     * @author: 喜杨杨
     * @date: 2022/9/21 16:57
     * @param: [phone]
     * @return: com.medical.medical.entity.Patient
     **/
    Patient getLoginUser(String phone);

    /**
     * @Description: 患者用户添加
     * @author: 喜杨杨
     * @date: 2022/9/21 16:58
     * @param: [patient]
     * @return: int
     **/
    int addPatient(Patient patient);

    List<Record> getReport(int id);
    /**
     * @description 获得条件下表中数据总条数
     * @author GUOYN
     * @date 2022-09-14 10:30:41  * @param phone
     * @param name
     * @param idCard
     * @return {@link int}
     */
    int getPatientCount(@Param("phone") long phone,
                        @Param("name") String name,
                        @Param("idCard") String idCard) throws Exception;
    /**
     * @description 获得当前页面信息
     * @author GUOYN
     * @date 2022-09-14 10:34:50  * @param phone
     * @param name
     * @param idCard
     * @param start
     * @param pageSize
     * @return {@link List<  Patient >}
     */
    List<Patient> getPatientList(@Param("phone") long phone,
                                 @Param("name") String name,
                                 @Param("idCard") String idCard,
                                 @Param("start") int start,
                                 @Param("pageSize") int pageSize) throws Exception;
    /**
     * @description 根据id获得当前用户详细信息
     * @author GUOYN
     * @date 2022-09-14 11:56:53  * @param id
     * @return {@link Patient}
     */
    Patient getPatientView(int id) throws Exception;
    /**
     * @description 根据id删除用户/患者
     * @author GUOYN
     * @date 2022-09-14 12:05:05  * @param id
     * @return {@link boolean}
     */
    int delPatientById(int id) throws Exception;
    /**
     * @description 根据当前用户id获得就诊状态
     * @author GUOYN
     * @date 2022-09-14 16:34:15  * @param idCard
     * @return {@link int}
     */
    Integer getRegStateByIDCard(int userId) throws Exception;
    /**
     * @description 根据当前用户id获得就诊时间
     * @author GUOYN
     * @date 2022-09-14 16:37:26  * @param id
     * @return {@link Date}
     */
    List<Date> getRecordTimeByIDCard(int userId) throws Exception;

     /**
      *@author WangLuDong
      *@Description 方法描述 修改用户患者个人信息
      *@Date 2022-09-16 09:48:25
       * @param patient
      *@Return {@link null}
      */
    int modifyPatientById(Patient patient);

    Patient getOne(int id);
}
